/* USER CODE BEGIN Header */
///**
//  ******************************************************************************
//  * @file           : main.h
//  * @brief          : Header for main.c file.
//  *                   This file contains the common defines of the application.
//  ******************************************************************************
//  * @attention
//  *
//  * <h2><center>&copy; Copyright (c) 2021 STMicroelectronics.
//  * All rights reserved.</center></h2>
//  *
//  * This software component is licensed by ST under BSD 3-Clause license,
//  * the "License"; You may not use this file except in compliance with the
//  * License. You may obtain a copy of the License at:
//  *                        opensource.org/licenses/BSD-3-Clause
//  *
//  ******************************************************************************
//  */
/* USER CODE END Header */

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __MAIN_H
#define __MAIN_H

#define LIMIT_MIN_MAX(x,min,max) (x) = (((x)<=(min))?(min):(((x)>=(max))?(max):(x)))

//#include "gpio.h"
#define LED_1_PIN  GPIO_PIN_1
#define LED_1_GPIO_PORT   GPIOG

#define LED_2_PIN  GPIO_PIN_2
#define LED_2_GPIO_PORT   GPIOG

#define LED_3_PIN  GPIO_PIN_3
#define LED_3_GPIO_PORT   GPIOG

#define LED_4_PIN  GPIO_PIN_4
#define LED_4_GPIO_PORT   GPIOG

#define LED_5_PIN  GPIO_PIN_5
#define LED_5_GPIO_PORT   GPIOG

#define LED_6_PIN  GPIO_PIN_6
#define LED_6_GPIO_PORT   GPIOG

#define LED_7_PIN  GPIO_PIN_7
#define LED_7_GPIO_PORT   GPIOG

#define LED_8_PIN  GPIO_PIN_8
#define LED_8_GPIO_PORT   GPIOG


#define KEY  GPIO_PIN_2
#define KEY_PORT   GPIOB

#define  KEY_OFF  0
#define  KEY_ON   1 
//#define LED_2  PGOUT(2)
//#define LED_3  PGOUT(3)
//#define LED_4  PGOUT(4)
//#define LED_5  PGOUT(5)
//#define LED_6  PGOUT(6)
//#define LED_7  PGOUT(7)
//#define LED_8  PGOUT(8)


//#define  LED_OFF  0
//#define  LED_ON   1  



#ifdef __cplusplus
extern "C" {
#endif

/* Includes ------------------------------------------------------------------*/
#include "stm32f4xx_hal.h"

/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */

/* USER CODE END Includes */

/* Exported types ------------------------------------------------------------*/
/* USER CODE BEGIN ET */

/* USER CODE END ET */

/* Exported constants --------------------------------------------------------*/
/* USER CODE BEGIN EC */

/* USER CODE END EC */

/* Exported macro ------------------------------------------------------------*/
/* USER CODE BEGIN EM */

/* USER CODE END EM */

/* Exported functions prototypes ---------------------------------------------*/
void Error_Handler(void);
//static float  pid_control(pid_Typedef*pid,float measure);
/* USER CODE BEGIN EFP */

/* USER CODE END EFP */

/* Private defines -----------------------------------------------------------*/
/* USER CODE BEGIN Private defines */

/* USER CODE END Private defines */

//void dianji(void);
void delay(int n);
#ifdef __cplusplus
}
#endif

#endif /* __MAIN_H */

/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
